import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'package:text_pixel/src/bean/bean.dart';

import '../method_channel/text_pixel_method_channel.dart';

abstract class TextPixelPlatform extends PlatformInterface {
  /// Constructs a TextPixelPlatform.
  TextPixelPlatform() : super(token: _token);

  static final Object _token = Object();

  static TextPixelPlatform _instance = MethodChannelTextPixel();

  /// The default instance of [TextPixelPlatform] to use.
  ///
  /// Defaults to [MethodChannelTextPixel].
  static TextPixelPlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [TextPixelPlatform] when
  /// they register themselves.
  static set instance(TextPixelPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<String?> getPlatformVersion() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  Future<ColorResult> getTextColors({
    required int width,
    required int height,
    required List<Map<String, dynamic>> textList,
    required int fontSize,
    required int maxFrames,
    required int maxLines,
    required bool continuousPaint,
    required bool horizontalCenter
  }) {
    throw UnimplementedError('getTextColors() has not been implemented.');
  }
}
